
<template>
  <div>
    <h1>测试</h1>
  </div>
</template>

<script setup >
import { ref } from 'vue'


const skuList = [
  {
    brandCode: "brandtaste202208051245600001",
    canBeGift: true,
    name: "经典款T恤",
    price: 99,
    stock: 100
  },
  {
    brandCode: "brandtaste202208051245600002",
    canBeGift: false,
    name: "时尚牛仔裤",
    price: 199,
    stock: 50
  },
  {
    brandCode: "brandtaste202208051245600003",
    canBeGift: true,
    name: "舒适运动鞋",
    price: 299,
    stock: 75
  }
];


const newSkuList = skuList.map(({ brandCode, name, ...rest })  => {
  // 解构赋值，排除 brandCode 和 name
//  const { brandCode, name, ...rest } = item;
  // 返回新对象，包含剩余属性和新属性 newname
  return {
    ...rest,
    newname: name
  };
});

console.log(skuList,'skuList')
console.log(newSkuList,'newSkuList')

const formData ={name:skuList.name}
console.log(formData,'formData')



</script>


